# -*- coding: utf-8 -*-
# Version:python3.7
from odoo import api, fields, models
class SysIrUiMenu(models.Model):

    _name = 'ir.ui.menu'
    _inherit = 'ir.ui.menu'
    @api.model
    def del_mail_discuss(self):
        # <delete model="ir.ui.menu" search="[('id','=', ref('mail.menu_root_discuss'))]"/>
        try:
            mail_obj = self.env['ir.ui.menu'].sudo().search([('id','=', self.env.ref('mail.menu_root_discuss').id)])
            if mail_obj.id:
                mail_obj.unlink()
        except Exception as e:
            pass
    def write(self, values):
        result = super(SysIrUiMenu, self).write(values)
        return result

